]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
messageTray: Drop createBanner()
authorJulian Sparber <julian@sparber.net>
Mon, 12 Feb 2024 09:16:36 +0000 (10:16 +0100)
committerFlorian Müllner <fmuellner@gnome.org>
Sun, 3 Mar 2024 01:33:16 +0000 (01:33 +0000)
This removes the `createBanner()` method on `Notification` and `Source`.
Since we want to use the same widget for the calendar and the banner,
let's not allow to create custom widgets just for the banner.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3173>

js/ui/messageTray.js

index 48731367ac0d1730a67bc6d2dfa71e0124eecd42..823b7b9ab2fe7266c575aac4fd552e7555f07fd0 100644 (file)
@@ -555,15 +555,6 @@ export const Notification = GObject.registerClass({
         this.sound?.play(this.title);
     }
 
-    // Allow customizing the banner UI:
-    // the default implementation defers the creation to
-    // the source (which will create a NotificationBanner),
-    // so customization can be done by subclassing either
-    // Notification or Source
-    createBanner() {
-        return this.source.createBanner(this);
-    }
-
     activate() {
         this.emit('activated');
 
@@ -664,10 +655,6 @@ export const Source = GObject.registerClass({
             : PrivacyScope.USER;
     }
 
-    createBanner(notification) {
-        return new NotificationBanner(notification);
-    }
-
     _onNotificationDestroy(notification) {
         let index = this.notifications.indexOf(notification);
         if (index < 0)
@@ -1160,7 +1147,7 @@ export const MessageTray = GObject.registerClass({
             this.idleMonitor.add_user_active_watch(this._onIdleMonitorBecameActive.bind(this));
         }
 
-        this._banner = this._notification.createBanner();
+        this._banner = new NotificationBanner(this._notification);
         this._banner.connectObject('done-displaying', this._escapeTray.bind(this), this);
 
         this._bannerBin.add_child(this._banner);